//Sun 07 Feb 2010 11:47:24 AM CST 
#include <vector>
#include <list>
#include <map>
#include <set>
#include <deque>
#include <queue>
#include <stack>
#include <bitset>
#include <algorithm>
#include <functional>
#include <numeric>
#include <utility>
#include <sstream>
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <cctype>
#include <string>
#include <cstring>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <ctime>

using namespace std;

class BouncingBalls
{
public:
	double expectedBounces(vector <int> x, int T)
	{
		sort(x.begin(), x.end());
		int N = x.size();
		int ret = 0;
		for(int mask=0; mask<(1<<N); mask++)
		{
			for(int i=0; i<N; i++)
				for(int j=i+1; j<N; j++)
				{
					if((mask&(1<<i)) && !(mask&(1<<j)) && x[j]-x[i]<=2*T)
						ret++;
				}
		}
		return 1.0*ret / (1.0*(1<<N));
	}
};
